﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FieldManage.aspx.cs" Inherits="GreatB2C.Web.Manage.SystemSet.Contents.FieldManage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>内容模型管理</title>
    <link href="../../../App_Themes/AdminDefaultTheme/index.css" type="text/css" rel="stylesheet" />
    <link href="../../../App_Themes/AdminDefaultTheme/MasterPage.css" type="text/css"
        rel="stylesheet" />

    <script type="text/javascript" src="../../../Resource/Script/pagebase.js"></script>

    <link rel="stylesheet" type="text/css" href="../../../Resource/jqueryEasyui/themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="../../../Resource/jqueryEasyui/themes/icon.css" />

    <script type="text/javascript" src="../../../Resource/jqueryEasyui/jquery-1.4.4.min.js"></script>

    <script type="text/javascript" src="../../../Resource/jqueryEasyui/jquery.easyui.min.js"></script>
    <script type="text/javascript">
        
        function showMenu(menuid) {
            $('#menu_' + menuid).menu('show', {
                left: pointerX(),
                top: pointerY()
            });
        }

        function order(objOrder , src_order) {
            var params = "";
            if (location.href.indexOf('?') > 0) {
                params = location.href.substring(location.href.indexOf('?') + 1);
            }
            
            location.href = "FieldManage.aspx?type=order&after=" + objOrder.value;
        }

        function AddField() {
            var ModelType = GetParamValue("ModelType");
            var ModelId = GetParamValue("ModelId");
            var ModelName = GetParamValue("ModelName");

            location.replace('Field.aspx?ModelType=' + ModelType + '&ModelId=' + ModelId + '&ModelName=' + ModelName);
        }
        
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div style="margin:4px;">
        <span style="display: inline-block; height: 20px;"><span>
            <img src="../../../App_Themes/AdminDefaultTheme/Images/localGIF.gif" align="absmiddle"
                style="border-width: 0px;" />后台管理 </span><span>&gt;&gt; </span><span><a>系统设置</a></span><span>
                    &gt;&gt; </span><span><a>模型管理</a></span><span> &gt;&gt; </span><span><a>字段管理</a></span></span>
    </div>
    <div style="margin:4px;">
        <table cellspacing="1" cellpadding="0" border="0" style="width: 100%;">
            <tr align="center">
                <td valign="top">
                    <asp:DataGrid ID="dgData" CssClass="border" runat="server" Width="100%" HeaderStyle-VerticalAlign="Top"
                        AutoGenerateColumns="False" BorderWidth="1px" PageSize="15" AllowPaging="False" CellSpacing="1"
                        OnItemDataBound="dgData_ItemDataBound" OnItemCommand="dgData_ItemCommand">
                        <PagerStyle Visible="False" />
                        <ItemStyle Height="25px" CssClass="tdbg" />
                        <Columns>
                            <asp:TemplateColumn HeaderText="操作">
                                <ItemTemplate>
                                    <div class="operatshortcut">
                                        <ul class="operatingMenu3">
                                            <li class="operatingMenu2" style="cursor: pointer;">
                                                <img src="../../../Resource/Images/dropdown.gif" border="0" onclick=showMenu('<%# Eval( "Id" ) %>') />
                                            </li>
                                        </ul>
                                    </div>
                                    <div id='menu_<%# Eval( "Id" ) %>' class="easyui-menu" style="width:120px; display:none;">
                                        <div iconCls="icon-list"><asp:LinkButton ID="lbtnUpdate" runat="server" style="height:20px; line-height:20px;" CommandName="Update" CommandArgument='<%# Eval( "Id" ) %>'>修改</asp:LinkButton></div>
                                        <div iconCls="icon-lock"><asp:LinkButton ID="lbtnEnabled" runat="server" style="height:20px; line-height:20px;" CommandName='<%# Convert.ToBoolean( Eval("Disabled") ) ? "Enabled" : "Disabled"%>' CommandArgument='<%# Eval( "Id" ) %>' Text='<%# Convert.ToBoolean( Eval("Disabled") ) ? "显示" : "不显示"%>'></asp:LinkButton></div>
                                        <div iconCls="icon-save"><asp:LinkButton ID="lbtnCopy" runat="server" style="height:20px; line-height:20px;" CommandName="Copy" CommandArgument='<%# Eval( "Id" ) %>'>复制</asp:LinkButton></div>
                                        <div iconCls="icon-cancel"><asp:LinkButton ID="lbtnDelete" runat="server" style="height:20px; line-height:20px;" OnClientClick="return confirm('删除字段将删除对应表中所有该字段的数据，是否删除该字段？');" CommandName="Delete" CommandArgument='<%# Eval( "Id" ) %>'>删除</asp:LinkButton></div>
                                    </div>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="120px" />
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:TemplateColumn>
                            <asp:BoundColumn DataField="FieldName" HeaderText="字段名">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="150px" />
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:BoundColumn>
                            <asp:BoundColumn DataField="FieldAlias" HeaderText="字段别名">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:BoundColumn>
                            <asp:BoundColumn DataField="FieldType" HeaderText="字段类型">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="150px" />
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:BoundColumn>
                            <asp:BoundColumn DataField="FieldLevel" HeaderText="字段级别">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="120px" />
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:BoundColumn>
                            <asp:BoundColumn DataField="EnableNull" HeaderText="是否必填">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="120px" />
                                <ItemStyle HorizontalAlign="Center" Font-Bold="true" />
                            </asp:BoundColumn>
                            <asp:BoundColumn DataField="Disabled" HeaderText="是否显示">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="120px" />
                                <ItemStyle HorizontalAlign="Center" Font-Bold="true" />
                            </asp:BoundColumn>
                            <asp:TemplateColumn HeaderText="排序">
                                <ItemTemplate>
                                    <asp:DropDownList ID="ddlOrderId" runat="server" ToolTip='<%# Eval( "OrderID" ) %>' AutoPostBack="true" OnSelectedIndexChanged="ddlOrderId_SelectedIndexChanged"></asp:DropDownList>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="120px" />
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:TemplateColumn>
                            <asp:BoundColumn DataField="OrderID" HeaderText="排序" Visible="false">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="120px" />
                                <ItemStyle HorizontalAlign="Center" Font-Bold="true" />
                            </asp:BoundColumn>
                        </Columns>
                        <HeaderStyle VerticalAlign="Top" Height="25px" CssClass="gridtitle"></HeaderStyle>
                    </asp:DataGrid>
                    <asp:Literal ID="litNone" runat="server"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td style="line-height:35px;">
                    <input type="button" name="btnAddField" value="添加字段[A]" class="btnstyle_blue" id="btnAddField"
                        accesskey="A" style="width: 80px;" onmouseover="this.className='btnstyle_blue_over'" onclick="AddField();"
                        onmouseout="this.className='btnstyle_blue'" />            
                    <asp:Button ID="btnSaveFields" runat="server" Text="保存排序[S]" 
                        class="btnstyle_blue" Style="width: 80px;"
                        AccessKey="S" onmouseover="this.className='btnstyle_blue_over'" 
                        onmouseout="this.className='btnstyle_blue'" onclick="btnSaveFields_Click"
                         />
                    <input type="button" name="btnPreview" value="模型预览[P]" class="btnstyle_blue" id="btnPreview"
                        accesskey="P" style="width: 80px;" onmouseover="this.className='btnstyle_blue_over'" onclick="Preview();"
                        onmouseout="this.className='btnstyle_blue'" />   
                </td>
            </tr>
        </table>
    </div>
    </form>
    <asp:Literal ID="litScript" runat="server"></asp:Literal>
</body>
</html>
